package com.whitlock.backend.domain;

import com.baomidou.mybatisplus.core.metadata.IPage;

import java.io.Serializable;
import java.util.List;

/**
 * 项目名称：pvms-backend 
 * 类名称：PvmsPage 
 * 类描述：分页查询
 * 创建人：JJH 
 * 创建时间：2019年10月6日 上午11:20:21
 * 
 * @version
 */
public class TKPage<T> implements Serializable {

	private static final long serialVersionUID = 1L;
	public long count;
	public long pageSize=10;
	public long pageNum=1;
	public List<T> data;

	public TKPage(IPage<T> pageData) {
		this.count = pageData.getTotal();
		this.data = pageData.getRecords();
		this.pageSize = pageData.getSize();
		this.pageNum = pageData.getCurrent();
	}

	public TKPage(long pageNum, long pageSize) {
		// TODO Auto-generated constructor stub
		this.pageSize = pageSize;
		this.pageNum = pageNum;
	}

	public TKPage(long count, List<T> data, long pageNum, long pageSize) {
		this.count = count;
		this.data = data;
		this.pageSize = pageSize;
		this.pageNum = pageNum;
	}

	public long getCount() {
		return count;
	}

	public void setCount(long count) {
		this.count = count;
	}

	public long getPageSize() {
		return pageSize;
	}

	public void setPageSize(long pageSize) {
		this.pageSize = pageSize;
	}

	public long getPageNum() {
		return pageNum;
	}

	public void setPageNum(long pageNum) {
		this.pageNum = pageNum;
	}

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}
}
